package com.ylbh.modules.freight.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ylbh.modules.freight.entity.ShoppingFreight;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

/**
 * 商城运费模板
 *
 * @author czx
 * @date 2019-12-16 09:52:17
 */
@Mapper
@Repository
public interface ShoppingFreightMapper extends BaseMapper<ShoppingFreight> {

    /**
     * 运费模板列表
     * @param keywords
     * @param page
     * @return
     */
    List<ShoppingFreight> selectFreightList(String keywords, Page<Integer> page);

    /**
     * 删除运费模板
     * @param ids
     */
    void deleteFreightById(@Param(value = "id") Long id, @Param(value = "date") Date date, @Param(value = "userId") Long userId);

    /**
     * 获取启用状态运费模板
     * @param page
     * @return
     */
    List<ShoppingFreight> selectEnableFreightList(Page<Integer> page);

    /**
     * 查询商品是否已经挂载这个运费模板
     * @param id
     * @return
     */
    int selectIsGoodsByFreightId(Long id);
}
